#{extends 'main.html' /}

#{set title:'Mon Profil' /}
<script type="text/javascript" src="../../../public/javascripts/md5.js"></script>
        <script type="text/javascript">
        	function encrypt(){
        		var pass=document.getElementById("pass1").value;
        		document.getElementById("password1").value=MD5(pass)
        		var pass=document.getElementById("pass2").value;
        		document.getElementById("password2").value=MD5(pass)
        		var pass=document.getElementById("pass3").value;
        		document.getElementById("password3").value=MD5(pass)
        	}
        </script>
<div id="profil">
    <div id="menu_right">
        <a href="/accueil">Page d'accueil</a>
    </div>

    <h2 class="post-title">
        Profil de ${agent_fullname}
    </h2>

    #{form @monProfilSave()}
    <p> 
        #{field 'Email'}
        <label id="email"> <b> Email : </b> </label>
        <input type="text" name="email" id="email" value="${agent?.email}"/>
        #{/field}
    </p>
    <p> 
        #{field 'Password1'}
        <label id="password"> <b> Mot de passe actuel : </b> </label>
        <input type="password" name="pass1" id="pass1" value="" />
		<input type="hidden" name="password1" id="password1" value="" />
		#{/field}
    </p>
    <p> 
        #{field 'Password2'}
        <label id="password"> <b> Nouveau mot de passe : </b> </label>
        <input type="password" name="pass2" id="pass2" value="" />
		<input type="hidden" name="password2" id="password2" value="" />
		#{/field}
    </p>
    <p> 
        #{field 'Password3'}
        <label id="password"> <b> Confirmer le mot de passe : </b> </label>
        <input type="password" name="pass3" id="pass3" value="" />
		<input type="hidden" name="password3" id="password3" value="" />
		#{/field}
    </p>
    <p> 
        #{field 'CisService'}
        <label id="cisService"> <b> CIS Service : </b> </label>
        <input type="text" name="cisService" id="cisService" value="${CISService}" disabled/> 
        #{/field}
    </p>
    <p> 
        #{field 'For'}
        <label id="for"> <b> FOR : </b> </label>
        <input type="text" name="for" id="for" value="${agent_niv}" disabled/>
        #{/field}
    </p>
    <p> 
        #{field 'Grade'}
        <label id="grade"> <b> Grade : </b> </label>
        <input type="text" name="grade" id="grade" value="${agent_grade}" disabled/>
        #{/field}
    </p>
    <p> 
        #{field 'Statut'}
        <label id="statut"> <b> Statut : </b> </label>
        <input type="text" name="statut" id="statut" value="${agent?.statut}" disabled />
        #{/field}
    </p>
    <p style="margin-top:30px">    
        <center><input type="submit" value="Modifier" onclick="encrypt()"/></center>
    </p>
    #{/form}
</div>